/**
 * @作者 伟子涵
 * @微信公号 搬砖暗夜码农
 * @开源项目 $ https://gitee.com/zhouwei5208888
 * @我的博客 $ http://itzhouwei.com
 * @创建时间 2023/11/30 19:36
 */
package com.itzhouwei.mybatis.session.defaults;

import com.itzhouwei.mybatis.binding.MapperRegistry;
import com.itzhouwei.mybatis.session.SqlSession;
import com.itzhouwei.mybatis.session.SqlSessionFactory;

/**
 * @description:  SqlSessionFactory 的默认实现
 * @author：zw，微信：yingshengzw
 * @date: 2023/11/30 19:36
 * @Copyright： 公众号：搬砖暗夜码农 | 博客：https://itzhouwei.com - 沉淀、分享、成长，让自己和他人都能有所收获！
 */
public class DefaultSqlSessionFactory  implements SqlSessionFactory {

    private final MapperRegistry   mapperRegistry;
   public  DefaultSqlSessionFactory(MapperRegistry mapperRegistry) {
        this.mapperRegistry = mapperRegistry;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(mapperRegistry);
    }
}
